package com.esbi.projectwebsocket.aiRequest;
import org.json.JSONException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/aiRequest")
public class AiRequestController {
    @Autowired
    private AiRequestService aiRequestService;

    @PostMapping("/importantInput")
    public ResultResponse handleRequest(@RequestBody String input) throws JSONException {
        String respond = aiRequestService.processInput(input);
        return ResultUtil.success(respond);
    }

}
